Introduction to GRASS GIS
Which GRASS?
GRASS GIS (Geographic Resources Analysis Support System), a FOSS suite used for geospatial data management and analysis, image processing, graphics and maps, spatial modeling, and visualization.
Originally developed by the U.S. Army Construction Engineering Research Laboratories for land management and environmental planning (1982-1995).
More history: https://grass.osgeo.org/about/history/
A bit of (geek) GRASS GIS history…
In case you didn’t notice, the video is narrated by William Shatner 🚀
GRASS GIS general stuff
- Free and open source, you can use, modify, improve, share
- Strong user community, commercial support
- Large amount of tools: 500+ core modules, 300+ addons
- GUI and CLI interfaces
- Python API and libraries - new
grass.jupyterlibrary can be tried online - Connection with R, QGIS, WPS, etc.
- Different data types supported: raster (including satellite imagery), 3D raster or voxel, vector and space-time datasets
More than 500 core modules
| Prefix | Function class | Type of command | Example |
|---|---|---|---|
| g.* | general | general data management | g.rename: renames map |
| d.* | display | graphical output | d.rast: display raster map |
| r.* | raster | raster processing | r.mapcalc: map algebra |
| v.* | vector | vector processing | v.clean: topological cleaning |
| i.* | imagery | imagery processing | i.pca: Principal Component Analysis |
| r3.* | voxel | 3D raster processing | r3.stats: voxel statistics |
| db.* | database | database management | db.select: select value(s) from table |
| ps.* | postscript | PostScript map creation | ps.map: PostScript map creation |
| t.* | temporal | space-time datasets | t.rast.aggregate: raster time series aggregation |
More than 300 add-ons
Plugins or Add-ons can be installed from a centralized OSGeo repository or from github (or similar repositories) using g.extension command.
# install extension from GRASS GIS Add-on repository
g.extension extension=r.hants
# install extension from github repository
g.extension extension=r3.slice \
url=https://github.com/petrasovaa/r3.sliceGraphical User Interface (GUI)
Command line
GRASS + R through rgrass package
We can use R within a GRASS GIS session or use GRASS GIS within an R session
Temporal support in GRASS GIS
The TGRASS framework
GRASS GIS was the first FOSS GIS that incorporated capabilities to manage, analyze, process and visualize spatio-temporal data, as well as the temporal relationships among time series.
- TGRASS is fully based on metadata and does not duplicate any dataset
- Snapshot approach, i.e., adds time stamps to maps
- A collection of time stamped maps (snapshots) of the same variable are called space-time datasets or STDS
- Maps in a STDS can have different spatial and temporal extents
Space-time datasets
- Space time raster datasets (STRDS)
- Space time 3D raster datasets (STR3DS)
- Space time vector datasets (STVDS)
Upcoming GRASS 8 will support image collections by adding a band reference
Temporal modules
- t.*: General modules to handle STDS of all types
- t.rast.*: Modules that deal with STRDS
- t.rast3d.*: Modules that deal with STR3DS
- t.vect.*: Modules that deal with STVDS
Other TGRASS notions
- Time can be defined as intervals (start and end time) or instances (only start time)
- Time can be absolute (e.g., 2017-04-06 22:39:49) or relative (e.g., 4 years, 90 days)
- Granularity is the greatest common divisor of the temporal extents (and possible gaps) of all maps in the space-time cube
- Topology refers to temporal relations between time intervals in a STDS.
TGRASS framework and workflow
Walk through space-time analysis for disease ecology with GRASS GIS and :r-project:
Demo session overview
Habitat suitability mapping for the Asian tiger mosquito in Northern Italy based on variables derived from daily LST data
- GRASS
- Import species records
- Create random background points
- Create different environmental layers from daily LST data
- R
- Read data from GRASS into R
- Model species distribution
- Model evaluation
- Visualization of results
Jarnevich et al. 2015. doi:10.1016/j.ecoinf.2015.06.007
Data for the session
- Records of Aedes albopictus (Asian tiger mosquito) in Northern Italy downloaded from GBIF
- Daily MODIS LST reconstructed by mundialis based on Metz et al. 2017
- 1 km spatial resolution
- Converted to Celsius degrees
:download: Get sample location, mosquito records and code :download:
- Create a folder named
grassdata_ogh - Download and unzip eu_laea location with LST mapset and unzip within your
grassdata_oghfolder - Download the asian tiger mosquito occurrences as
.gpkgfile - Download the GRASS script
- Download the R script
The grassdata_ogh folder’s tree should look like this:
grassdata_ogh/
└── eu_laea
├── italy_LST_daily
└── PERMANENT